﻿using System;
using System.Collections.Generic;
using System.Text;
using System.ServiceModel;
using System.ComponentModel;
using System.Runtime.Serialization;

namespace ServerNodeLib
{
	/// <summary>
	/// Captures the final result of a batch completing,
	/// regardless if the batch was a success.
	/// </summary>
	[DataContract()]
	public class ResultInfo
	{
		/// <summary>
		/// The server guid of the batch that completed.
		/// </summary>
		[DataMember()]
		public Guid BatchId;
		/// <summary>
		/// True if the batch completed successfully.
		/// Successful batches will be cleared by the server.
		/// </summary>
		[DataMember()]
		[DefaultValue(false)]
		public bool IsSuccess;
		/// <summary>
		/// A human-readable summary message of the outcome.
		/// Exceptions are placed here.
		/// </summary>
		[DataMember()]
		[DefaultValue("")]
		public String SummaryMessage;
		/// <summary>
		/// The time the batch started executing.
		/// </summary>
		[DataMember()]
		public DateTime StartTime;
		/// <summary>
		/// The time the batch stopped executing.
		/// </summary>
		[DataMember()]
		public DateTime EndTime;
		/// <summary>
		/// A list of granular results from each command that was executed.
		/// </summary>
		[DataMember()]
		public List<CommandResult> CommandResults;
		/// <summary>
		/// A list of granular results from sending and receiving resources.
		/// </summary>
		[DataMember()]
		public List<ResourceResult> ResourceResults;
	}
}
